@extends('admin.layout.index')
@section('content')
<div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="card">
                        <div class="card-action">
                             Advanced Tables
                        </div>
                        <div class="card-content">
                            <div class="table">

                           <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline" role="grid">
                           	<div class="row">
                           	
                     <div class="col-sm-6">


							

                            

<form class="form-inline" action="/admin/classified/index" method="get">
  
</div>
<div class="col-sm-6">
  <div class="form-group">
  	<div id="dataTables-example_filter" class="dataTables_filter">
          <label>一级分类关键字:<input value="{{ $search or '' }}" type="search" name="search" class="form-control input-sm" aria-controls="dataTables-example">
                  </label>
    
  
  <button type="submit" class="btn btn-default"> 搜索 </button>
</form>
  <button type="submit" class="btn btn-primary" info="create" grade="0" pid="0" onclick="fun(this)"> 创建一级分类 </button>
</div>



                        </div>
                    </div>
                </div>
                <!-- ==================== -->

<div id="my_create" class="input-field col s12" style="z-index:5;display:none;position: fixed;left:500px;top:200px;background:#F5F5F5;height:50px">
			
          <input id="my_classified" type="text" style="width:500px" class="validate">
          <label for="my_classified" class=""><font size="3"><i id="my_reminder"> 根目录下创建分类 </i></font> 请输入你要创建的分类名称</label>
				<button type="submit" class="btn btn-primary" info="my_button"> 确认创建 </button>
				<button type="submit" class="btn btn-default" info="my_button"> 取消创建 </button>
          
        </div>
                 <!-- ==================== -->
                    <table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables-example" aria-describedby="dataTables-example_info">
                                    <thead>
                                        <tr role="row">
                                        	
                                        	<th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 200px;"> 分类名称</th>
                                        	<th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 200px;"> 创建时间
                                        </th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 141px;"> 分类等级
                                        </th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 99px;"> 分类下商品
                                        </th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 99px;"> 添加子分类
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        
            						@foreach($data as $v)
                                    <tr class="gradeA odd warning">
                                            
                                            <td class=" ">{{ $v['classname'] }}</td>
                                            <td class=" ">{{ date('y-m-d h:i:s',$v['ctime']) }}</td>
                                            <td class="center ">一级分类</td>
                                            <td class="center "><a class="btn-floating red" href="/admin/classified/showgoods?class=1&id={{ $v['id'] }}" style="transform: scaleY(1) scaleX(1) translateY(0px) translateX(0px); opacity: 1;"><i class="material-icons">insert_chart</i></a></td>
                                            <td class="center "><a class="waves-effect waves-light btn" grade="1" pid="{{ $v['id'] }}" info="create" onclick="fun(this)"><i class="material-icons">publish</i></a></td>
                                        </tr>
                                        @foreach($v['sub'] as $vv)
                                        <tr class="gradeA odd success">
                                           
                                            <td class=" ">=〉{{ $vv['classname'] }}</td>
                                            <td class=" ">{{ date('y-m-d h:i:s',$vv['ctime']) }}</td>
                                            <td class="center ">二级分类</td>
                                            <td class="center "><a class="btn-floating red" href="/admin/classified/showgoods?class=2&id={{ $vv['id'] }}" style="transform: scaleY(1) scaleX(1) translateY(0px) translateX(0px); opacity: 1;"><i class="material-icons">insert_chart</i></a></td>
                                            <td class="center "><a class="waves-effect waves-light btn" grade="2" pid="{{ $vv['id'] }}" info="create" onclick="fun(this)"><i class="material-icons">publish</i></a></td>
                                        </tr>
                                        	@foreach($vv['sub'] as $vvv)
	                                        	<tr class="gradeA odd active">
	                                           
	                                            <td class=" ">==〉{{ $vvv['classname'] }}</td>
	                                            <td class=" ">{{ date('y-m-d h:i:s',$vvv['ctime']) }}</td>
	                                            <td class="center ">三级分类</td>
                                              <td class="center "><a class="btn-floating red" href="/admin/classified/showgoods?class=3&id={{ $vvv['id'] }}" style="transform: scaleY(1) scaleX(1) translateY(0px) translateX(0px); opacity: 1;"><i class="material-icons">insert_chart</i></a></td>
	                                            <td class="center "><a class="btn disabled" ><i class="material-icons">publish</i></a></td>
	                                        </tr>
                                        	@endforeach
                                        @endforeach
                                     @endforeach  
                                       </tbody>
                                </table><div class="row">
                                <div class="col-sm-6">
                                	<div class="dataTables_info" id="dataTables-example_info" role="alert" aria-live="polite" aria-relevant="all">Showing 1 to 10 of 57 entries
                                	</div>
                                </div>
                              
                                				</div>
                                			</div>
                            </div>
                            
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
                
@endsection
@section('classified')

<script src="/adminassets/classified.js"></script>
@endsection